<?php
namespace Home\Model;
use Think\Model\RelationModel;
	class ArticleModel extends RelationModel{ 
		
		protected $_auto=array(
			array('created_at','nowtime',1,'callback'),
			array('status','0'),
		);

		protected $_link=array(
		
			'Cate'=> array(  
     			'mapping_type'=>self::BELONGS_TO,
          		'class_name'=>'ArticleCate',
          		'foreign_key'=>'cate_id',
				'mapping_name'=>'cate',
				'mapping_fields'=>'name',
				'as_fields'=>'name',
			),
		
		);
		

		protected function nowtime(){
	        return strtotime('now');
	    }
	}
?>
